<template>
        <div class="aaa">
111
<p class="aa">222</p>
<p class="aa">222</p>
<p class="aa">222</p>
<p class="aa">222</p>
<p class="aa">222</p>

<div class="top">
    <div class="zuo" ref="continer">
        <div class="you">
            <div>
                <span>男生</span>
                <span>女生</span>
            </div>
            <div class="you1">
                <div v-for="(item,index) in data" :key="index">
                <div>{{ item.num }}</div>
                <div>{{ item.floor }}</div>
            </div>
            </div>
            
        </div>
</div>


</div>
        </div>
</template>
    
<script setup lang='ts'>
import * as echarts from 'echarts'
import { onMounted,ref,shallowRef } from 'vue';
import { getmenjin } from '../request/api';

const data=ref([])
let option=ref({})
const continer=shallowRef()

onMounted(()=>{
    getmenjin().then(res=>{
        data.value=res.data.data.result[0].tableData
        var myChart=echarts.init(continer.value)
        option.value=res.data.data.result[0].option
        myChart.setOption(option.value)
        const onresize=()=>{
            myChart.resize()
        }
        onresize()
        window.addEventListener('resize',onresize)
    })
})
</script>
    
<style scoped lang="scss">
    .aaa{
        width: 100%;
        height: 80%;
        background-color: #fff;
        margin-top: 10%;
        .aa{
            font-size: 19px;
            display: flex;
            justify-content: space-around;
            align-items: center;
            color: pink;
            border:1px solid #ccc;
            
        }
        .top{
            font-size: 16px;
            margin-top: 10px;
            width: 100%;
            height: 160px;
            background-color: #0c1d5f;
            display: flex;
            align-items: center;
            justify-content: space-around;
        }
        .zuo{
            width: 45% !important;
            height: 130px;
        }
        .you{
            color: white;
        }
        .you > div:nth-child(1){
            height: 60px;
            line-height: 60px;
            text-align: center;
            span{
                margin: 0px 20px;
            }
        }
        .you1{
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-around;
            text-align: center;
            font-size: 14px ;
            color: #ccc;
            margin: 0px 10px;
        }
        .you1 div {
            margin: 0px 5px;
        }
    }
</style>